On Correct Program Schemas
نویسندگان
چکیده
Extended Abstract 1 Introduction A program schema is an abstraction of a class of actual programs, in the sense that it represents their data-ow and control-ow, but does not contain (all) their actual computations or (all) their actual data structures. Program schemas have been shown to be useful in a variety of applications, such as proving properties of programs, teaching programming to novices, guiding manual and/or (semi-)automatic synthesis of programs, debugging programs, transforming programs, and so on, both within and without logic programming. An overview of schemas and their applications can be found in 5, 6]. In this paper, we present our work on three aspects of schemas: representation, correctness, and usage, in the context of logic program synthesis. In logic programming, most researchers represent their schemas as higher-order expressions, sometimes augmented by extra-logical annotations and features, so that actual ((rst-order) programs are obtained by applying higher-order substitutions to the schema. We shall take a diierent approach and show that schemas can also be expressed as open rst-order programs, viz. programs in which some of the relations are open, i.e. left undeened. One advantage of this approach is that it simpliies the semantics of schemas and of their manipulations. We shall endow schemas with a formal (model-theoretic) semantics by setting them in the context of a framework, i.e. an axiomatisation of the (possibly open) problem domain. This allows us to deene a meaningful notion of correctness for schemas. Indeed, we show that correct program schemas can be expressed as steadfast open programs, i.e. programs that are always correct provided their open relations, i.e. their parameters, are computed correctly. Steadfastness is a priori correctness, and therefore correct schemas are a priori correctly reusable. We shall also discuss how to use correct schemas in practice. Using any kind of schemas requires suitable strategies, and we shall present some ideas on such strategies for correct schemas. 2 Schemas as Open Programs Our approach to schemas (and program synthesis) is set in the context of a (fully) rst-order axiomati-sation F of the problem domain in question, which we call a framework F. Speciications are given in F, i.e. written in the language of F. We adopt a model-theoretic semantics for F, and for speciications and (deenite logic) programs in F. This declarative approach enables us to deene program correctness wrt 1 speciications not only for closed programs but also for open programs, i.e. programs …
منابع مشابه
Correct-Schema-Guided Synthesis of Steadfast Programs
It can be argued that for (semi-)automated software development, program schemas are indispensable, since they capture not only structured program design principles, but also domain knowledge, both of which are of crucial importance for hierarchical program synthesis. Most researchers represent schemas purely syntactically (as higher-order expressions). This means that the knowledge captured by...
متن کاملGeneralised Logic Program Transformation Schemas
Schema-based logic program transformation has proven to be an eeective technique for the optimisation of programs. This paper results from the research that began by investigating the suggestions in 11] to construct a more general database of transformation schemas for optimising logic programs at the declarative level. The proposed transformation schemas fully automate accumulator introduction...
متن کاملStaged Program Repair in SPR
We present SPR, a new program repair system that uses condition synthesis to instantiate transformation schemas to repair program defects. SPR’s staged repair strategy combines a rich space of potential repairs with a targeted search algorithm that makes this space viably searchable in practice. This strategy enables SPR to successfully find correct program repairs within a space that contains ...
متن کاملLogic Program Schemas, Constraints and Semi-Uni cation
Program schemas are known to be useful in di erent applications such as program synthesis, transformation, analysis, debugging, teaching : : :This paper tackles two complementary aspects of program schemas. We rst propose a language for the description of program schemas. It is based on a subset of second-order logic, enhanced with constraints and speci c features of program schemas. One of the...
متن کاملLogic Program Schemas, Constraints, and Semi-unification
Program schemas are known to be useful in diierent applications such as program synthesis, transformation, analysis, debugging, teaching : : : This paper tackles two complementary aspects of program schemas. We rst propose a language for the description of program schemas. It is based on a subset of second-order logic, enhanced with constraints and speciic features of program schemas. One of th...
متن کامل